// import { turn } from "core-js/fn/array"

const user = {
	state: {
		isLogin: false,
		userData: {},
    frontChatShow: false,
    adminChatShow: false,
    frontChatNowMen:{}
	},
	mutations: {
		userLogin(state, payload) {
			state.isLogin = true
			state.userData = payload
		},
		userLogout(state) {
			state.isLogin = false
			state.userData = {}
		},
		frontChatShowing(state, payload) {
      state.frontChatShow = payload.show
      state.frontChatNowMen = payload.nowMen

		},
		adminChatShowing(state, payload) {
      state.adminChatShow = payload
		},
	},
	actions: {},
	getters: {
		getUserData(state) {
			return state.userData
		},
		getIsLogin(state) {
			return state.isLogin
		},
		getFrontChatShow(state) {
			return state.frontChatShow
    },
    
		getAdminChatShow(state) {
			return state.adminChatShow
    },
    getFrontChatNowMen(state){
			return state.frontChatNowMen

    }
    
	},
}

export default user
